define(
		[ "PDUtilDir/util", "PDUtilDir/tool", "PDUtilDir/slidebar",
				"PDUtilDir/grid" ],
		function(Util, Tool, Slidebar, Grid) {
			function detailForPaySupportInit($scope, $compile) {
				return new detailForPaySupport($scope, $compile);
			}
			function detailForPaySupport($scope, $compile) {
				this.$scope = $scope;
				this.$compile = $compile;
			}
			detailForPaySupport.fn = detailForPaySupport.prototype;
			detailForPaySupport.fn.digest = function() {
				this.$scope.$digest();
			};
			detailForPaySupport.fn.run = function(id) {
				var _this = this;
				_this.entity = {
					id : id,
					data: new Array()
				};
				this.slidebars = Slidebar({
					size : 'lg',
					url : getServer()
							+ "/static/app/order/serviceOrderInfos/views/detailForPay.html",
					// close : true,
					$scope : this.$scope,
					$compile : this.$compile,
					afterLoad : function($Panel) {
						_this.initialization();
					}
				});
			};
			detailForPaySupport.fn.initialization = function() {
				var _this = this;
				$.ajax({
					url : getServer() + "/flea/hclv/serviceOrder/getPayItmesByOrderNo.htmls",
					data : {
						model : _this.entity.id
					},
					success : function(data) {
						_this.entity.data = data.data;
						_this.renderGrid();
					}
				});
			};
			detailForPaySupport.fn.renderGrid = function() {
				var _this = this;
				Grid({
					id : "detailForPayOrderInfoGirdDivId",
					pageSize : 10,
//					index : true,
					multi : true,
					pagination : true,
					cache : false,
					layout : [/* {
						name : "订单号",
						field : "orderNo",
						sort : false
					},*/ {
						name : "支付方",
						field : "payOrgName",
						sort : true
					}, {
						name : "支付人",
						field : "payUser",
						sort : true
					}, {
						name : "支付方式",
						field : "payPlatform",
						format : function(e) {
							return _this.$scope.cache.typeMap.get(e.row.payPlatform);
						}
					}, {
						name : "支付金额",
						field : "payMoney"
					}, {
						name : "流水号",
						field : "platformNumber"
					}/*, {
						name : "支付状态",
						field : "platformStatus",
						format : function(e) {
							return _this.$scope.cache.orderStatusMap.get(e.row.platformStatus);
						}
					}*/, {
						name : "接收方",
						field : "receiveOrgName"
					}, {
						name : "支付时间",
						field : "createTime"
					} ],
					data : _this.entity.data
				});
			};
			return detailForPaySupportInit;
		});